<?php
	header("Content-type:text/html;charset=utf-8");
	
	$id = $_GET["userId"];
	$name = $_GET["userName"];
	
	$conn = mysql_connect("localhost","root","root");
	
	mysql_select_db("2107");
	
	$result = mysql_query("select * from student where stu_id=$id AND stu_name='$name'",$conn);

	if(mysql_num_rows($result) == 1){
		echo "用户已经存在";
	}else{
		echo "用户可以注册";
		mysql_query("insert into student values($id,'$name',18,'1988-5-16')",$conn);
	}
	
	mysql_close($conn);
?>